home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sprite 1984 - 1993
/
Sprite 1984 - 1993.iso
/
src
/
lib
/
c
/
mig
/
RCS
/
Mig_Evict.c,v
< prev
next >
Wrap
Text File
|
1990-06-22
|
4KB
|
165 lines
head 2.1;
branch ;
access ;
symbols no-auto-remigrate:2.1 installed:2.0;
locks ; strict;
comment @ * @;
2.1
date 90.06.22.14.58.20; author douglis; state Exp;
branches ;
next 2.0;
2.0
date 90.03.10.13.12.42; author douglis; state Stable;
branches ;
next 1.2;
1.2
date 90.02.28.10.57.43; author douglis; state Exp;
branches ;
next 1.1;
1.1
date 90.02.16.14.28.12; author douglis; state Exp;
branches ;
next ;
desc
@Force the daemon on the local host to evict foreign processes.
This might be useful if one is remotely logged into a host
and wishes to evict processes, since automatic migration is done
when the user is physically present to interact with the host.
@
2.1
log
@changes for alarms for timeouts with migd and for printing to stderr instead of syslog
@
text
@/*
* Mig_Evict.c --
*
* Force the daemon on the local host to evict foreign processes.
* This might be useful if one is remotely logged into a host
* and wishes to evict processes, since automatic migration is done
* when the user is physically present to interact with the host.
*
* Copyright 1990 Regents of the University of California
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies. The University of California
* makes no representations about the suitability of this
* software for any purpose. It is provided "as is" without
* express or implied warranty.
*/
#ifndef lint
static char rcsid[] = "$Header: /sprite/src/lib/c/mig/RCS/Mig_Evict.c,v 2.0 90/03/10 13:12:42 douglis Stable Locker: douglis $ SPRITE (Berkeley)";
#endif /* not lint */
#include <sprite.h>
#include <stdio.h>
#include <mig.h>
#include <errno.h>
/*
*----------------------------------------------------------------------
*
* Mig_Evict --
*
* Tell the local daemon to evict foreign processes.
*
* Results:
* The number of processes evicted is returned if the call is successful,
* or -1 is returned on error, with errno indicating the error.
*
* Side effects:
* Does ioctl to server.
*
*----------------------------------------------------------------------
*/
int
Mig_Evict()
{
int status;
int numHosts;
if (mig_LocalPdev < 0) {
if (MigOpenPdev(FALSE) < 0) {
return(-1);
}
}
if (MigSetAlarm() < 0) {
fprintf(stderr,
"Error setting alarm for contact with migd.\n");
return(-1);
}
status = Fs_IOControl(mig_LocalPdev, IOC_MIG_EVICT,
0, (char *) NULL,
sizeof(int), (char *) &numHosts);
if (MigClearAlarm() < 0) {
fprintf(stderr,
"Error clearing alarm for contact with migd.\n");
}
if (status != SUCCESS) {
fprintf(stderr,
"Mig_Evict: error during ioctl to local daemon: %s\n",
Stat_GetMsg(status));
errno = Compat_MapCode(status);
return(-1);
}
return(numHosts);
}
@
2.0
log
@Changing version numbers.
@
text
@d20 1
a20 1
static char rcsid[] = "$Header: /sprite/src/lib/c/mig/RCS/Mig_Evict.c,v 1.2 90/02/28 10:57:43 douglis Exp Locker: douglis $ SPRITE (Berkeley)";
a27 1
#include <syslog.h>
d58 5
d66 4
d71 1
a71 1
syslog(LOG_WARNING,
@
1.2
log
@changed Mig_OpenPdev to internal Mig routine.
@
text
@d20 1
a20 1
static char rcsid[] = "$Header: /sprite/src/lib/c/mig/RCS/Mig_Evict.c,v 1.1 90/02/16 14:28:12 douglis Exp Locker: douglis $ SPRITE (Berkeley)";
@
1.1
log
@Initial revision
@
text
@d20 1
a20 1
static char rcsid[] = "$Header: /user2/douglis/pdev_mig/mig_p/RCS/Mig_Evict.c,v 1.1 90/02/08 20:22:10 douglis Exp Locker: douglis $ SPRITE (Berkeley)";
d54 1
a54 1
if (Mig_OpenPdev(FALSE) < 0) {
@